import { axios } from '@/utils/request';

const api = {
    // 考评项目分类
    schemeDeptUser: '/eval/scheme/deptUserTree',
    getEvalParent: '/eval/type/getEvalParent',
    classifyList: '/eval/type/getAll',
    getAll: '/eval/type/query',
    create: '/eval/type/create',
    update: '/eval/type/update',
    typeDelete: '/eval/type/delete', // 删除
    // 考评项目定义
    itemQuery: '/eval/item/query',
    itemUpdate: '/eval/item/update',
    itemCreate: '/eval/item/create',
    itemDelete: '/eval/item/delete',
    itemUpdateOrder: '/eval/item/updateOrder',
    // 考评方案
    allDept: '/system/dept/all',
    evalItemGet: '/eval/item/get',
    schemeQuery: '/eval/scheme/page',
    schemeUpdate: '/eval/scheme/update',
    schemeCreate: '/eval/scheme/create',
    // planDelete: '/eval/plan/delete',
    schemeDelete: '/eval/scheme/delete',
    schemeDetail: '/eval/scheme/get', // 考评方案详情
    getEvalAll: '/eval/scheme/getEvalAll', // 获取所有项目分类
    // 考评计划
    planQuery: '/eval/plan/page',
    planUpdate: '/eval/plan/update',
    planUpdateAll: '/eval/plan/updateAll',
    planCreate: '/eval/plan/create',
    planDelete: '/eval/plan/delete',
    getDetail: '/eval/plan/get',
    getEvalSchemeAll: '/eval/scheme/getEvalSchemeAll',
    getDeptUserTree: '/eval/scheme/getDeptUserTree',
    getDeptPositionTree: '/system/dept/getDeptPositionTree',
    // 我的考评任务
    taskUpdate: '/eval/task/update',
    taskDetail: '/eval/task/get',
    taskGetParam: '/eval/task/getParm', // 点击详情调用
    startEval: '/eval/task/startEval',
    notFinishedTask: '/eval/task/getNotFinishedTask',
    finishedTask: '/eval/task/getFinishedTask',
    eventCreate: '/eval/task/event/create',
    eventDelete: '/eval/task/event/delete',
    evalUpdate: '/eval/task/update', //开始考评提交
    queryHistory: '/eval/task/event/queryItemHistoryTask',
    finishedDetail: '/eval/task/getFinishedTaskParm',
    updateDetailedItem: '/eval/detailed/item/updateDetailedItem',
    // 追加考评项
    detailedItemCreate: '/eval/detailed/item/create',
    detailedItemDelete: '/eval/detailed/item/delete', // 删除追加项
    // 考评申报
    // applyCreate: '/eval/apply/create',
    applyCreate: '/eval/apply/createEvalApplyUser',
    getUserExamine: '/eval/apply/detail/getUserExamine',
    getDeptExamine: '/eval/apply/detail/getDeptExamine',
    applyDelete: '/eval/apply/detail/delete',
    updateUserExamine: '/eval/apply/detail/updateUserExamine',
    updateUserExamineList: '/eval/apply/detail/updateUserExamineList',
    updateDeptExamine: '/eval/apply/detail/updateDeptExamine',
    updateDeptExamineList: '/eval/apply/detail/updateDeptExamineList',
    getByEvalTarget: '/eval/type/getByEvalTarget',
    getByEvalTargetApply: '/eval/type/getByEvalTargetApply', // 获取申报项目
    getDeptExamineAll: '/eval/apply/detail/getDeptExamineAll', // 全院人员申报记录列表
    getApplyExamineUser: '/eval/apply/detail/getApplyExamineUser', // 个人申报记录列表
    getApplyExamineDept: '/eval/apply/detail/getApplyExamineDept', // 科室人员申报记录
    getApplyExamineOurDept: '/eval/apply/detail/getApplyExamineOurDept', // 本科室申报记录
    getApplyExamineAllDept: '/eval/apply/detail/getApplyExamineAllDept', // 全院科室
    getEvalApplyAll: '/eval/apply/detail/getEvalApplyAll',
    commonPosition: '/eval/plan/getSysDeptPosition',
    planVerifyPage: '/eval/detailed/page',
    planVerifyTable: '/eval/task/event/getEvalTaskEvent',
    evalTaskEventCommit: '/eval/task/event/evalTaskEventCommit'
};
export function evalTaskEventCommit(data) {
    return axios({
        url: api.evalTaskEventCommit,
        method: 'put',
        data
    });
}

export function planVerifyTable(params) {
    return axios({
        url: api.planVerifyTable,
        method: 'get',
        params
    });
}

export function planVerifyPage(params) {
    return axios({
        url: api.planVerifyPage,
        method: 'get',
        params
    });
}

export function commonPosition(params) {
    return axios({
        url: api.commonPosition,
        method: 'get',
        params
    });
}

export function getEvalApplyAll(params) {
    return axios({
        url: api.getEvalApplyAll,
        method: 'get',
        params
    });
}

// getByEvalTargetApply
export function getByEvalTargetApply(params) {
    return axios({
        url: api.getByEvalTargetApply,
        method: 'get',
        params
    });
}

export function getApplyExamineUser(params) {
    return axios({
        url: api.getApplyExamineUser,
        method: 'get',
        params
    });
}

export function getApplyExamineDept(params) {
    return axios({
        url: api.getApplyExamineDept,
        method: 'get',
        params
    });
}

export function getApplyExamineOurDept(params) {
    return axios({
        url: api.getApplyExamineOurDept,
        method: 'get',
        params
    });
}

export function getApplyExamineAllDept(params) {
    return axios({
        url: api.getApplyExamineAllDept,
        method: 'get',
        params
    });
}

// getDeptExamineAll
export function getDeptExamineAll(params) {
    return axios({
        url: api.getDeptExamineAll,
        method: 'get',
        params
    });
}

export function getByEvalTarget(params) {
    return axios({
        url: api.getByEvalTarget,
        method: 'get',
        params
    });
}

export function updateDeptExamineList(data) {
    return axios({
        url: api.updateDeptExamineList,
        method: 'put',
        data
    });
}

export function updateUserExamineList(data) {
    return axios({
        url: api.updateUserExamineList,
        method: 'put',
        data
    });
}

export function updateDeptExamine(data) {
    return axios({
        url: api.updateDeptExamine,
        method: 'put',
        data
    });
}

// updateUserExamine
export function updateUserExamine(data) {
    return axios({
        url: api.updateUserExamine,
        method: 'put',
        data
    });
}

export function applyDelete(id, params = {}) {
    return axios({
        url: `${api.applyDelete}/${id}`,
        method: 'delete',
        params
    });
}

export function getDeptExamine(params) {
    return axios({
        url: api.getDeptExamine,
        method: 'get',
        params
    });
}

export function getUserExamine(params) {
    return axios({
        url: api.getUserExamine,
        method: 'get',
        params
    });
}

// applyCreate
export function applyCreate(data) {
    return axios({
        url: api.applyCreate,
        method: 'post',
        data
    });
}

// detailedItemDelete
export function detailedItemDelete(params) {
    return axios({
        url: api.detailedItemDelete,
        method: 'delete',
        params
    });
}

// schemeDeptUser 部门用户树
export function schemeDeptUser(params) {
    return axios({
        url: api.schemeDeptUser,
        method: 'get',
        params
    });
}

// 全部部门 allDept
export function allDept(params) {
    return axios({
        url: api.allDept,
        method: 'get',
        params
    });
}

// 考评项目定义 itemDelete
export function itemDelete(id, data) {
    return axios({
        url: `${api.itemDelete}/${id}`,
        method: 'delete',
        data
    });
}

// 考评分类删除 typeDelete
export function typeDelete(id, data) {
    return axios({
        url: `${api.typeDelete}/${id}`,
        method: 'delete',
        data
    });
}

// 考评-确定按钮 updateDetailedItem 
export function updateDetailedItem(id, data) {
    return axios({
        url: `${api.updateDetailedItem}/${id}`,
        method: 'put',
        data
    });
}

// taskGetParam 详情
export function taskGetParam(params) {
    return axios({
        url: api.taskGetParam,
        method: 'get',
        params
    });
}

// detailedItemCreate
export function detailedItemCreate(data) {
    return axios({
        url: api.detailedItemCreate,
        method: 'post',
        data
    });
}

// evalItemGet
export function evalItemGet(id, params) {
    return axios({
        url: `${api.evalItemGet}/${id}`,
        method: 'get',
        params
    });
}

// 考评项目分类-获取父级parentId
export function getEvalParent(params) {
    return axios({
        url: api.getEvalParent,
        method: 'get',
        params
    });
}

// 考评分类获取全部列表
export function classifyList(params) {
    return axios({
        url: api.classifyList,
        method: 'get',
        params
    });
}

// 考评项目分类-获取列表
export function getAll(params) {
    return axios({
        url: api.getAll,
        method: 'get',
        params
    });
}

// 考评项目分类-新增
export function create(data) {
    return axios({
        url: api.create,
        method: 'post',
        data
    });
}

// 考评项目分类-修改
export function update(data) {
    return axios({
        url: api.update,
        method: 'put',
        data
    });
}

// 考评项目定义-获取列表
export function itemQuery(params) {
    return axios({
        url: api.itemQuery,
        method: 'get',
        params
    });
}

// 考评项目定义-修改数据
export function itemUpdate(data) {
    return axios({
        url: api.itemUpdate,
        method: 'put',
        data
    });
}

// 考评项目定义-修改数据
export function itemCreate(data) {
    return axios({
        url: api.itemCreate,
        method: 'post',
        data
    });
}

// 考评项目定义-修改排序
export function itemUpdateOrder(data) {
    return axios({
        url: api.itemUpdateOrder,
        method: 'put',
        data
    });
}

// 考评方案-分页查询
export function schemeQuery(params) {
    return axios({
        url: api.schemeQuery,
        method: 'get',
        params
    });
}

// 考评方案-修改数据
export function schemeUpdate(data) {
    return axios({
        url: api.schemeUpdate,
        method: 'put',
        data
    });
}

// 考评方案-新增数据
export function schemeCreate(data) {
    return axios({
        url: api.schemeCreate,
        method: 'post',
        data
    });
}

// 考评方案-删除数据
export function schemeDelete(id, data) {
    return axios({
        url: `${api.schemeDelete}/${id}`,
        method: 'delete',
        data
    });
}

// schemeDetail
export function schemeDetail(id, params) {
    return axios({
        url: `${api.schemeDetail}/${id}`,
        method: 'get',
        params
    });
}

// getEvalAll
export function getEvalAll(params) {
    return axios({
        url: api.getEvalAll,
        method: 'get',
        params
    });
}

// 考评方案-分页查询
export function planQuery(params) {
    return axios({
        url: api.planQuery,
        method: 'get',
        params
    });
}
// 考评方案-修改数据-四步
export function planUpdateAll(data) {
    return axios({
        url: api.planUpdateAll,
        method: 'put',
        data
    });
}

// 考评方案-修改状态数据
export function planUpdate(data) {
    return axios({
        url: api.planUpdate,
        method: 'put',
        data
    });
}

// 考评计划-新增数据
export function planCreate(data) {
    return axios({
        url: api.planCreate,
        method: 'post',
        data
    });
}

// 考评计划-删除数据
export function planDelete(id, data) {
    return axios({
        url: `${api.planDelete}/${id}`,
        method: 'delete',
        data
    });
}

// 考评计划-获取详情信息
export function getDetail(id, params) {
    return axios({
        url: `${api.getDetail}/${id}`,
        method: 'get',
        params
    });
}

// 新增考评计划-获取考评模板 
export function getEvalSchemeAll(params) {
    return axios({
        url: api.getEvalSchemeAll,
        method: 'get',
        params
    });
}

// 新增考评计划-获取部门人员树
export function getDeptUserTree(params) {
    return axios({
        url: api.getDeptUserTree,
        method: 'get',
        params
    });
}

// 新增考评计划-获取部门岗位树
export function getDeptPositionTree(params) {
    return axios({
        url: api.getDeptPositionTree,
        method: 'get',
        params
    });
}

// notFinishedTask 
export function notFinishedTask(params) {
    return axios({
        url: api.notFinishedTask,
        method: 'get',
        params
    });
}

export function finishedTask(params) {
    return axios({
        url: api.finishedTask,
        method: 'get',
        params
    });
}

// 我的考评任务-修改数据
export function taskUpdate(data) {
    return axios({
        url: api.taskUpdate,
        method: 'put',
        data
    });
}

// 我的考评任务-开始考评
export function taskDetail(params) {
    return axios({
        url: api.taskDetail,
        method: 'get',
        params
    });
}

// 我的考评任务-开始考评列表
export function startEval(id, params) {
    return axios({
        url: `${api.startEval}/${id}`,
        method: 'get',
        params
    });
}

// 考评任务-新增事件
export function eventCreate(data) {
    return axios({
        url: api.eventCreate,
        method: 'post',
        data
    });
}

// 考评任务-删除事件
export function eventDelete(id, data) {
    return axios({
        url: `${api.eventDelete}/${id}`,
        method: 'delete',
        data
    });
}

// evalUpdate
export function evalUpdate(data) {
    return axios({
        url: api.evalUpdate,
        method: 'put',
        data
    });
}

// 考评任务-查询历史
export function queryHistory(params) {
    return axios({
        url: api.queryHistory,
        method: 'get',
        params
    });
}

// 已完成任务详情
export function finishedDetail(id, params) {
    return axios({
        url: `${api.finishedDetail}/${id}`,
        method: 'get',
        params
    });
}
